﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Problem1
{
    class Client
    {
        String nume;

        public String Nume
        {
            get { return nume; }
            set { nume = value; }
        }
        int varsta;

        public int Varsta
        {
            get { return varsta; }
            set { varsta = value; }
        }
        List <AbstractCar>list;
        public Client(String nume, int varsta)
        {
            this.nume = nume;
            this.varsta = varsta;
            this.list = new List<AbstractCar>();
        }

        public void addMasina(AbstractCar masina)
        {
            list.Add(masina);
        
        }

        public void deleteMasina(AbstractCar car)
        { 
            foreach (AbstractCar masina in this.list)
                if (masina.Equals(car))
                {
                    this.list.Remove(masina);
                    Console.WriteLine("s a sters masina cautata :" + car.ToString() + "\n");
                    return; 
                }
            Console.WriteLine("masina : "+car.ToString()+" nu s a gasit la client\n");
        }

    }
}
